//===============================================================================
// Microsoft patterns & practices
// Guidance Explorer Offline Client
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================



using System.Windows.Forms;
using GuidanceExplorer.Controls;
using GuidanceExplorer.Model;

namespace GuidanceExplorer.Services
{
    public interface IWinFormsRenderService
    {

        /// <summary>
        /// Render an instance of the Guidance model into a TreeView control.
        /// </summary>
        /// <param name="guidance">The instance in the model.</param>
        /// <param name="treeView">The tree view instance to render to.</param>
        void RenderGuidanceToTreeView(Guidance guidance, TreeView treeView);

        /// <summary>
        /// Renders the guidance associated with a Visual Studio Solution to the TreeView
        /// </summary>
        /// <param name="guidance"></param>
        /// <param name="treeView"></param>
        void RenderSolutionToTreeView(Guidance guidance, TreeView treeView);

        /// <summary>
        /// Refresh the guidance associated with a Visual Studio Solution to the TreeView. Used when importing  SolutionNodes
        /// </summary>
        /// <param name="guidance"></param>
        /// <param name="treeView"></param>
        void RefreshSolutionToTreeView(Guidance guidance, TreeView treeView);
        
        /// <summary>
        /// Renders a library into a LibraryNode in the TreeView.
        /// </summary>
        /// <param name="library"></param>
        /// <param name="libraryNode"></param>
        void RenderLibraryToLibrariesNode(TreeView treeView, Guidance guidance, Library library, LibrariesNode librariesNode);

        /// <summary>
        /// Refresh the GuidanceType nodes that belong to the library
        /// </summary>
        /// <param name="libraryNode">LibraryNode to refresh</param>
        /// <param name="guidanceType">GuidanceType updated</param>
        void RefreshGuidanceTypeNodes(LibraryNode libraryNode, GuidanceType guidanceType);

        /// <summary>
        /// Populates the given ComboBox with the items' information
        /// </summary>
        /// <param name="combo"></param>
        /// <param name="field"></param>
        /// <param name="items"></param>
        void PopulateCombo(ComboBox combo, Field field, GuidanceItemCollection items);

        /// <summary>
        /// Return the library node for the provided library.
        /// </summary>
        /// <param name="library"></param>
        /// <returns></returns>
        LibraryNode GetLibraryNodeByLibrary(TreeView treeView, Library library);

        /// <summary>
        /// Return the libraries node.
        /// </summary>
        /// <param name="library"></param>
        /// <returns></returns>
        LibrariesNode GetLibrariesNode(TreeView treeView);

        SolutionNode GetSolutionNode(TreeView treeView);

        /// <summary>
        /// Return the node for the given GuidanceItem
        /// </summary>
        /// <param name="treeView"></param>
        /// <param name="guidanceItem"></param>
        /// <returns></returns>
        GuidanceItemNode GetGuidanceItemNode(TreeView treeView, GuidanceItemFileReference guidanceItem);

        /// <summary>
        /// Return the node for the given GuidanceItem given its parent node
        /// </summary>
        /// <param name="treeView"></param>
        /// <param name="guidanceItem"></param>
        /// <returns></returns>
        GuidanceItemNode GetGuidanceItemNode(TreeView treeView, TreeNode parentNode, GuidanceItemFileReference guidanceItem);

    }
}

